package com.sv.web.list;

import org.springframework.ui.Model;

import com.sv.model.PageInfo;
import com.sv.web.ListSqlIdParam;

public abstract class ListPageInitializaion {

    private String listSqlId;
    
    protected PageInfo page = new PageInfo();
    
    public abstract void initClause(Model model);
    
    public ListPageInitializaion(ListSqlIdParam listSqlId){
        page.setListSqlId(listSqlId.toString()) ;
    }

    public PageInfo initPage(int curPage,int perPage,Model model){
        page.setCurPage(curPage);
        page.setPerPage(perPage);
        
        initClause(model);
        
        return page;
    }
    
    public String getListSqlId() {
        return listSqlId;
    }

    public void setListSqlId(String listSqlId) {
        this.listSqlId = listSqlId;
    }

    public PageInfo getPage() {
        return page;
    }

    public void setPage(PageInfo page) {
        this.page = page;
    }
    
    
}
